//
//  InfoViewController.m
//  FlowerRainGround
//
//  Created by lanou on 16/4/22.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "InfoViewController.h"

@interface InfoViewController ()
@property (strong, nonatomic) IBOutlet UIWebView *WebView;

@end

@implementation InfoViewController


- (void) requestData{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    [manager GET:[NSString stringWithFormat:@"http://m.htxq.net/servlet/SysArticleServlet?action=getArticleDetail&articleId=%@",self.ContantId ] parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves error:nil];
        
        //展示详情
        NSURL *url1 = [NSURL URLWithString:dic[@"result"][@"pageUrl"]];
        NSURLRequest *request = [NSURLRequest requestWithURL:url1];
        [self.WebView loadRequest:request];
       
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"1111%@", error);
    }];
}










- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = self.stringTitle;
    [self requestData];
    
    
    
    
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
